import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
export default new Router({
    // mode: 'history',
    routes: [{
        path: '/',
        redirect: '/MainPage'
    }, {
        path: '/MainPage',
        component: resolve => require(['../components/Page/MainPage.vue'], resolve),
    },  {
        path: '/PhotoWall',
        component: resolve => require(['../components/PersonCenter/PhotoWall/Photo.vue'], resolve),
        },{
        path: '/ReadingBook',
        component: resolve => require(['../components/Book/ReadingBook.vue'], resolve),
    }, {
        path: '/ListenMusic',
        component: resolve => require(['../components/Music/ListenMusic.vue'], resolve),
    }, {
        path: '/UserSettings',
        component: resolve => require(['../components/User/UserSettings.vue'], resolve),
        children: [
            {
                path: '/',
                redirect: '/PersonalCenter'
            },
            {
                path: '/PersonalCenter',
                component: resolve => require(['../components/User/UserSettings/PersonalCenter.vue'], resolve),
            },
            {
                path: '/RoleManage',
                component: resolve => require(['../components/User/UserSettings/RoleManage.vue'], resolve),
            },
            {
                path: '/PageSetting',
                component: resolve => require(['../components/User/UserSettings/PageSetting.vue'], resolve),
            }
        ]
    }]
})
